Venue 21 - weather comparison#
Venue 21 is a classic church, usually heated only for Sunday services. They were wondering how their internal temperature relates to the weather. This weather station is in an undisclosed location in a city close to the venue.
Show code cell source
# import ipywidgets as widgets
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
df1 = pd.read_csv("./venue-21/venue_21_with_device_3083988F23C0.csv")
df2 = pd.read_csv("./venue-21/venue-21-weather.csv")
df1 = df1[(df1.temperature >-10)] # eliminate rogue data
print(df2)
trace1 = go.Scatter(customdata=df1,
y=df1['temperature'],
x = df1['timestamp'],
mode='lines',
hoverinfo='all',
name='internal temperature (degC)',
)
trace2 = go.Scatter(customdata=df2,
y=df2['temperature'],
x = df2['timestamp'],
mode='lines',
hoverinfo='all',
name='external temperature (degC)',
)
g = go.FigureWidget(data=[trace1,trace2],
layout = go.Layout(
yaxis=dict(range=[-13,25])
))
fig = go.Figure(g)
fig.update_layout(showlegend=True,
autosize = True,
width=1000,
height=500,
)
fig.update_layout(
hovermode='x unified',
# range=[range_min, range_max],
hoverlabel=dict(
bgcolor="white",
# font_size=16,
font_family="Rockwell"
)
)
#Add range slider
fig.update_layout(
xaxis=dict(
rangeselector=dict(
buttons=list([
dict(
label="All",
step="all"
),
dict(count=1,
label="Hour",
step="hour",
stepmode="todate"),
dict(count=1,
label="Day",
step="day",
stepmode="backward"),
dict(count=7,
label="Week",
step="day",
stepmode="backward"),
dict(count=1,
label="Year",
step="year",
stepmode="backward")
])
),
rangeslider=dict(
visible=True,
),
type="date"
)
)
#fig.add_hline(y=16, annotation_text='16C - usual minimum for children', annotation_font_color="blue", line_color='red', layer='above', line_dash='dash')
# fig.update_yaxes(range = [-5, dfCollatedDataSet['temperature'].max()+5])
fig.show()
timestamp temperature windspeed rh
0 2023-03-01T00:50Z 6 7 76
1 2023-03-01T01:20Z 6 10 71
2 2023-03-01T01:50Z 6 7 71
3 2023-03-01T02:20Z 6 10 76
4 2023-03-01T03:20Z 5 12 81
.. ... ... ... ..
721 2023-03-19T17:50Z 8 8 71
722 2023-03-19T18:20Z 8 6 71
723 2023-03-19T18:50Z 7 5 81
724 2023-03-19T19:20Z 7 3 87
725 2023-03-19T20:20Z 7 5 87
[726 rows x 4 columns]
/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/jupyter_client/session.py:719: UserWarning: Message serialization failed with:
Out of range float values are not JSON compliant
Supporting this message is deprecated in jupyter-client 7, please make sure your message is JSON-compliant
content = self.pack(content)